/******************************************************************************
** @file	test_adcm_domain.cpp
** @author  Natty Choque Choque
**
** @date	Agost 26, 2010
**
** @desc	
**			
**
******************************************************************************/

#include "unit--.h"
#include "..\ADCM\ADCM_Domain.h"
#include "..\ADCM\ADCM_Computer.h"
#include <string>
#include <vector>
#include <iostream>


using namespace unit_minus;
using namespace std;

testSuite(ADCMSuite);

testCase(ADCMDomainTest1, ADCMSuite)
{
    cout << "---------- Start Domain Test ----------" << endl;
    wstring domainController = L"localhost";
    wstring Fqdn = L"devs.domain.local";
	ADCM_Domain domain(domainController,Fqdn);
	wstring user = L"dev01";
	wstring pass = L"abc.123";
	vector<ADCM_Computer> computers;
	domain.loadComputers(user, pass, computers);
	
	for(vector<ADCM_Computer>::iterator it = computers.begin(); it!=computers.end(); it++)
	{
		wcout << (*it).getCn() << endl;
		wcout << (*it).getOs() << endl;
	}

    cout << "---------- End Process Test ----------" << endl << endl;
    //getkey();
    system("PAUSE");
}

testCase(ADCMDomainTest2, ADCMSuite)
{
    cout << "---------- Start Domain Test ----------" << endl;
    wstring domainController = L"server";
    wstring Fqdn;
    wcout << "Input the Fully Qualifier Domain Name : ";
    wcin >> Fqdn;
	ADCM_Domain domain(domainController,Fqdn);
    wstring user;
    wcout << "Input valid Domain credentials " << endl;
    wcout << "User name : ";
    wcin >> user;
    wstring pass;
    wcout << "Password : ";
    wcin >> pass;

	vector<ADCM_Computer> computers;
	domain.loadComputers(user, pass, computers);
	
	for(vector<ADCM_Computer>::iterator it = computers.begin(); it!=computers.end(); it++)
	{
		wcout << (*it).getCn() << endl;
		wcout << (*it).getOs() << endl;
	}

    cout << "---------- End Process Test ----------" << endl << endl;
    system("PAUSE");
}
